<?php

//require_once 'protected/vendor/RAD/RAD.php';
//require_once 'protected/vendor/RAD/Autoloader.php';
//RAD_Autoloader::register();
require_once 'protected/vendor/RAD/RAD/RAD.php';
require_once 'protected/config/AppKernel.php';
use RAD\RAD;
$modulesPath = __DIR__.DIRECTORY_SEPARATOR.'protected'.DIRECTORY_SEPARATOR.'modules';
$basePath = __DIR__.DIRECTORY_SEPARATOR.'protected';
RAD::app()
        ->setBasePath($basePath)
        ->setModulesPath($modulesPath)
        ->setKernel(new \Application\config\AppKernel())
        ->run();


//$result = RAD_Database::ins()
//        ->setConfiguration('mysql:host=localhost;dbname=mysite', 'root', 'mypassword')
//        ->exec('SELECT * FROM users')
//        ->findAll();
//var_dump($result); exit;


//RAD_Config::ins()->setConfigFile('protected/config/config.php');
//var_dump(RAD_Config::ins()->getConfig()); exit;

//
//$file = __DIR__ .'/protected/config/routes.php';
//RAD_Router::ins()
//        ->setRouteFile($file)
////        ->setAfterRunMethod('afterRun')
////        ->setBeforeRunMethod('beforeRun')
//        ->setControllerSuffix('Controller')
//        ->setActionPrefix('action')
//        ->setModulesPath(array(
//            'backend'=>__DIR__.'/protected/modules/backend/controller',
//            'frontend'=>__DIR__,'/protected/modules/frontend/controller',
//        ))
//        ->setError404('frontend','ErrorController','error404')
//        ->run();
        

//RAD::ins()->run();